<!DOCTYPE html>
<!-- saved from url=(0030)http://my.sto.cn/Address/Index -->
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8;">
    <title></title>

    <script type="text/javascript" src="/admin/js/jquery.min.js"></script>
    <script src="/home/branch/js/jquery.cookie.js"></script>
    <script src="/home/branch/js/idangerous.swiper.min.js"></script>
    <script src="/home/userManager/js/icheck.js"></script>
    <script src="/home/userManager/js/jquery.tmpl.min.js"></script>
    <script src="/home/userManager/js/address.js"></script>
    <script src="/home/userManager/js/baseUtility.js"></script>
    <script src="/home/js/msg.js"></script>
    <script src="/home/js/city-picker.data.js"></script>
    <script src="/home/js/city-picker.js"></script>
    <link rel="stylesheet" type="text/css" href="/home/userManager/css/common.css">
    <link rel="stylesheet" type="text/css" href="/home/userManager/css/red.css">
    <link rel="stylesheet" type="text/css" href="/home/branch/css/city-picker.css">
    <link rel="stylesheet" type="text/css" href="/home/userManager/css/combo.select.css">
    <link rel="stylesheet" type="text/css" href="/home/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="/home/layui/css/modules/layer/default/layer.css">
    <link rel="stylesheet" type="text/css" href="/home/userManager/css/userAddress.css">

    <style>
        .layui-laypage .layui-laypage-curr .layui-laypage-em {
            position: absolute;
            left: -1px;
            top: -1px;
            padding: 1px;
            width: 100%;
            height: 100%;
            background-color: #F08C48;
        }
    </style>
</head>
<body>

<#include "../common/header.ftl">
<#include "../common/top_nav.ftl">
<div class="box" style="min-height:800px;">


    <div class="viewAddress">
        <input type="hidden" value="40851184de11479fb6adb52f37e1324b" id="hiddenUserId" name="hiddenUserId">
        <div class="left">
            <div class="title">
                <span><img src="/home/userManager/images/user.png" alt="账户icon"></span>
                <span class="titleText">账户管理</span>
            </div>
            <ul>
                <li><a class="<#if active == 0>on</#if>" href="/home/userManager/index">基本信息</a></li>
                <li><a class="<#if active == 1>on</#if>" href="/home/address/list">地址中心</a></li>
                <li><a class="<#if active == 2>on</#if>" href="/home/userManager/realName">实名认证</a></li>
            </ul>
        </div>
        <div class="right">
            <div class="orderInputBox">
                <form method="get" action="/home/address/list">
                    <select id="searchCategory" name="searchCategory" lay-verify="" tabindex="-1">
                        <#if searchCategory??>
                            <#if searchCategory == "name">
                                <option value="name">姓名</option>
                                <option value="mobile">手机号</option>
                            <#else >
                                <option value="mobile">手机号</option>
                                <option value="name">姓名</option>
                            </#if>
                        <#else>
                            <option value="name">姓名</option>
                            <option value="mobile">手机号</option>
                        </#if>
                    </select>
                    <input type="text" class="orderSearchBox" id="searchContent"
                           placeholder="可以输入姓名或电话" value="${search!""}" name="search">
                    <input type="submit" id="searchAddressBtn" class="orderSearchBtn" value="搜索">
                    <input type="button" class="addAddressBtn" value="+增加地址">
                </form>
            </div>

            <table border="0" cellpadding="0" cellspacing="0">
                <tbody>
                <tr class="titleBox">
                    <th class="titleName">姓名</th>
                    <th class="titleTel">手机号</th>
                    <th class="titleTel">座机号</th>
                    <th class="titleAddress">详细地址</th>
                    <th class="titleOperate">类别</th>
                    <th class="titleOperate">操作</th>
                </tr>
                </tbody>
                <tbody id="addressList">
                  <#if pageBean.content?size gt 0>
                      <#list pageBean.content as homeUserAddress>
                        <tr>
                            <td class="tableName">${homeUserAddress.name!""}
                                <#if homeUserAddress.isDefault == 0 && homeUserAddress.homeUserType.getCode() == 0>
                                    <img src="/home/images/addressJ.png" alt="默认地址">
                                <#elseif homeUserAddress.isDefault == 0 && homeUserAddress.homeUserType.getCode() == 1>
                                    <img src="/home/images/addressR.png" alt="默认地址">
                                </#if>
                            </td>
                            <td class="tableTel">${homeUserAddress.mobile!""}</td>
                            <td class="tableTel">${homeUserAddress.phone!""}</td>
                            <td class="tableAddress">${homeUserAddress.detailedAddress!""}</td>
                            <td class="tablelOperate">
                                <#if homeUserAddress.homeUserType.getCode() == 0>
                                    <p>寄件人</p>
                                <#else>
                                    <p>收件人</p>
                                </#if>
                            </td>
                            <td class="tablelOperate">
                                <p>
                                    <a class="addresColor update" href="javascript:void(0)"
                                       onclick="updateAddress('${homeUserAddress.id}')">修改
                                    </a>|
                                    <a class="addresColor del" href="javascript:void(0)"
                                       onclick="addressDelete('${homeUserAddress.id}')">删除</a>
                                </p>
                                 <#if homeUserAddress.isDefault == 1>
                                    <p><span class="isDefaultBtn" onclick="isDefaultAddress('${homeUserAddress.id}')">默认地址</span>
                                    </p>
                                 </#if>
                            </td>
                        </tr>
                      </#list>
                  </#if>

                </tbody>
            </table>
            <div id="test1" style="float: right;margin-right: 270px; margin-top: 30px">

            </div>
        </div>

    </div>

    <div id="addAddress" class="addAddress">
        <form id="addForm">
            <p class="addPersonInfo addP ">
                <label>姓名：</label>
                <input type="text" class="addName" name="name" id="name" maxlength="11">
            </p>
            <p class="addP">
                <label>手机号：</label>
                <input type="text" class="addTel" name="mobile" id="mobile" maxlength="13">
            </p>
            <p class="addP">
                <label>座机号：</label>
                <input type="text" class="addTel" name="phone" id="phone" maxlength="13">
            </p>
            <p class="addP addAddressInfo">
                <label>省市区：</label>
                <input id="address" class="addressChoose city-picker-input" name="address" readonly="readonly"
                       type="text" data-toggle="city-picker" placeholder="请选择省市区">
            </p>
            <p class="addTar">
                <label>详细地址：</label>
                <textarea class="addTel" name="detailedAddress" id="detailedAddress" maxlength="100"
                          placeholder="xx路xx号xx小区x幢x单元xx"></textarea>
            </p>
            <p class="addP">
                <label>设为默认地址</label>
                <input type="checkbox" id="isDefault"/>
                <label>寄件人地址</label>
                <input type="radio" name="homeUserType" value="${SENDER}" checked>
                <label>收件人地址</label>
                <input type="radio" name="homeUserType" value="${RECIPIENT}">
            </p>
            <p class="btnBox">
                <input type="reset" class="reser" value="重置" id="clearBtn">
                <input type="button" class="submit" value="提交" id="submitBtn">
            </p>
        </form>
    </div>

    <div id="editAddress" class="addAddress">
        <form id="editForm">
            <input type="hidden" name="id">
            <p class="addPersonInfo addP ">
                <label>姓名：</label>
                <input type="text" class="addName" name="name" id="upName" maxlength="11">
            </p>
            <p class="addP">
                <label>手机号：</label>
                <input type="text" class="addTel" name="mobile" id="upMobile" maxlength="13">
            </p>
            <p class="addP">
                <label>座机号：</label>
                <input type="text" class="addTel" name="phone" id="upPhone" maxlength="13">
            </p>
            <p class="addP addAddressInfo">
                <label>省市区：</label>
                <input id="upAddress" class="addressChoose city-picker-input" name="address" readonly="readonly"
                       type="text" data-toggle="city-picker" placeholder="请选择省市区">
            </p>
            <p class="addTar">
                <label>详细地址：</label>
                <textarea class="addTel" name="detailedAddress" id="upDetailedAddress" maxlength="100"
                          placeholder="xx路xx号xx小区x幢x单元xx"></textarea>
            </p>
            <p class="addP">
                <label>设为默认地址</label>
                <input type="checkbox" id="upIsDefault">
                <label>寄件人地址</label>
                <input type="radio" name="homeUserType" value="${SENDER}" id="SENDER">
                <label>收件人地址</label>
                <input type="radio" name="homeUserType" value="${RECIPIENT}" id="RECIPIENT">
            </p>
            <p class="btnBox">
                <input type="reset" class="reser" value="重置" id="clearEditBtn">
                <input type="button" class="submit" value="保存" id="submitEditBtn">
            </p>
        </form>
    </div>

    <style>
        .fastentrydiv {
            margin-bottom: -30px;
        }

        .fastentry {
            color: #ee6900;
            margin-left: 100px;
        }

        Fastentry {
            display: none;
        }

        .submitBtnfast input:hover {
            background: #f46c00;
        }

        .submitBtnfast {
            text-align: center;
            margin-top: 30px;
        }

        .submitBtnfast input {
            width: 100px;
            height: 30px;
            border: none;
            outline: none;
            background: #ee6900;
            color: #fff;
            font-size: 16px;
            border-radius: 6px;
            cursor: pointer;
        }

        .Fastentry {
            display: none;
        }

        .submitBtnfast input:hover {
            background: #f46c00;
        }

        .fasttitle {
            margin-bottom: 20px;
            margin-top: -5px;
            text-align: center;
        }

        .radiobutoon {
            width: 100px;
        }

        .Fastentrycontent {
            text-align: center;
            line-height: 30px;
        }

        .Fastentrycontentarer {
            width: 550px;
            height: 78px;
            resize: none;
            border: 1px solid #ededed;
            border-radius: 4px;
            outline: none;
            text-indent: 0.5em;
            padding-top: 10px;
            border-radius: 4px;
        }
    </style>
</div>
<#--尾部-->
    <#include "../common/footer.ftl"/>

<script src="/home/layer/layer.js"></script>
<script src="/home/layui/layui.all.js"></script>
<script type="text/javascript" src="/home/userManager/js/jquery.combo.select.js"></script>
<script type="text/javascript" src="/home/userManager/js/common_select.js"></script>
<script>
    var M = {};
    M.count = ${pageBean.total};
    M.curr = ${pageBean.currentPage};
    layui.use('laypage', function () {
        var laypage = layui.laypage;
        laypage.render({
            elem: 'test1' //注意，这里的 test1 是 ID，不用加 # 号
            , count: M.count //数据总数，从服务端得到
            , limit:${pageBean.pageSize}
            , curr: M.curr
            , jump: function (obj, first) {
                //首次不执行
                if (!first) {
                    M.curr = obj.curr;
                    location.href = "/home/address/list/?currentPage=" + obj.curr + '&searchCategory=${searchCategory!""}' + '&search=${search!""}';
                }
            }
        });
    });
</script>
</body>
</html>